import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'
import Home from '../views/Home.vue'
// import Slideshow from '../views/slideshow/Slideshow.vue'
// import Recipe from '../views/recipe/Recipe.vue'
const Slideshow = () => import('../views/slideshow/Slideshow.vue')
const Recipe = () => import('../views/recipe/Recipe.vue')



import $api from "../api"
import store from "../store"
Vue.use(VueRouter)

const routes = [{
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  },

  {
    path: '/home',
    name: 'Home',
    component: Home,
    children: [{
        path: 'slideshow',
        name: 'Slideshow',
        component: Slideshow,
        meta: {
          title: "轮播图管理"
        }
      },
      {
        path: 'recipe',
        name: 'Recipe',
        component: Recipe,
        meta: {
          title: "菜谱管理"
        }
      },
      {
        path: "/home",
        redirect: "/home/main"
      },
      {
        path: "main",
        component: () => import("../views/main.vue")
      },
      {
        path: 'user',
        component: () => import('../views/users/user.vue'),
      },
      {
        path: 'addAdmin',
        component: () => import('../views/users/AddAdmin.vue'),
      },
      {
        path: 'recipes',
        component: () => import('../views/recipe/recipes.vue'),
      },
      {
        path: 'addRecipe',
        component: () => import('../views/recipe/addRecipe.vue'),
      },
      {
        path: 'changeRecipe',
        component: () => import('../views/recipe/changeRecipe.vue'),
      },
      {
        path:"vips",
        component:()=>import("../views/subPage/vips/vip.vue"),
      },
      
      { 
        path:"addvips",
        component:()=>import("../views/subPage/vips/AddVip.vue")
      },
    ]
   

  },



]

const router = new VueRouter({
  mode: 'history',
  // base: process.env.BASE_URL,
  routes
})

export default router